<?php
/**
 * @package framework
 * @subpackage views
 *
 * @author Philippe Archambault <philippe.archambault@gmail.com>
 * @version 0.1
 * @license http://www.gnu.org/licenses/gpl.html GPL License
 * @copyright Philippe Archambault, 2008
 */
?>
<h1><?php echo __(ucfirst($action).' supplier'); ?></h1>

<form action="<?php echo $action=='edit' ? get_url('supplier/edit/'.$supplier->id): get_url('supplier/add'); ; ?>" method="post">
  <table class="fieldset" cellpadding="0" cellspacing="0" border="0">
    <tr>
      <td class="label"><label for="supplier_name"><?php echo __('Name'); ?></label></td>
      <td class="field"><input class="textbox" id="name" maxlength="100" name="supplier[name]" size="100" type="text" value="<?php echo $supplier->name; ?>" /></td>
      <td class="help"><?php echo __('Required.'); ?></td>
    </tr>
	
	 <tr>
      <td class="label"><label for="address"><?php echo __('Address'); ?></label></td>
      <td class="field"><input class="textbox" id="address" maxlength="100" name="supplier[address]" size="100" type="text" value="<?php echo $supplier->address; ?>" /></td>
      <td class="help"><?php echo __('Required.'); ?></td>
    </tr>
	
	<tr>
      <td class="label"><label for="mobile"><?php echo __('Mobile Number'); ?></label></td>
      <td class="field"><input class="textbox" id="mobile" maxlength="100" name="supplier[mobile]" size="100" type="text" value="<?php echo $supplier->mobile; ?>" /></td>
      <td class="help"><?php echo __('Required.'); ?></td>
    </tr>
	
	<tr>
      <td class="label"><label for="mobile"><?php echo __('Office Number'); ?></label></td>
      <td class="field"><input class="textbox" id="office_number" maxlength="100" name="supplier[office_number]" size="100" type="text" value="<?php echo $supplier->office_number; ?>" /></td>
      <td class="help"><?php echo __('Required.'); ?></td>
    </tr>
	
	<tr>
      <td class="label"><label for="email"><?php echo __('Email'); ?></label></td>
      <td class="field"><input class="textbox" id="email" maxlength="100" name="supplier[email]" size="100" type="text" value="<?php echo $supplier->email; ?>" /></td>
      <td class="help"><?php echo __('Required.'); ?></td>
    </tr>
	
	<tr>
      <td class="label"><label for="website"><?php echo __('Website'); ?></label></td>
      <td class="field"><input class="textbox" id="website" maxlength="100" name="supplier[website]" size="100" type="text" value="<?php echo $supplier->website; ?>" /></td>
      <td class="help"><?php echo __('Required.'); ?></td>
    </tr>
	
	<tr>
      <td class="label"><label for="facebook_page"><?php echo __('Facebook Page'); ?></label></td>
      <td class="field"><input class="textbox" id="website" maxlength="100" name="supplier[facebook_page]" size="100" type="text" value="<?php echo $supplier->facebook_page; ?>" /></td>
      <td class="help"><?php echo __('Required.'); ?></td>
    </tr>
	
	<tr>
      <td class="label"><label for="about_us"><?php echo __('About Us'); ?></label></td>
      <td class="field">
		<textarea class="textbox" cols="40" id="about_us" name="supplier[about_us]" rows="20" style="width: 100%">
			<?php echo htmlentities($supplier->about_us, ENT_COMPAT, 'UTF-8'); ?>
		</textarea>
	</td>
	<td class="help">&nbsp;</td>
    </tr>
	
	<tr>
      <td class="label"><label for="review"><?php echo __('Review'); ?></label></td>
      <td class="field">
		<textarea class="textbox" cols="40" id="about_us" name="supplier[review]" rows="20" style="width: 100%">
			<?php echo htmlentities($supplier->review, ENT_COMPAT, 'UTF-8'); ?>
		</textarea>
	</td>
	<td class="help">&nbsp;</td>
    </tr>
	
	<tr>
      <td class="label"><label for="share_to_social_site"><?php echo __('Share To Social Site?'); ?></label></td>
      <td class="field">
		<input id="share_to_social_site" name="supplier[share_to_social_site]" class="checkbox" type="checkbox" <?php if ($supplier->share_to_social_site) echo ' checked="checked"'; ?>/>
	  </td>
      <td class="help"><?php echo __('Required.'); ?></td>
    </tr>
  </table>

  <p class="buttons">
    <input class="button" name="commit" type="submit" accesskey="s" value="<?php echo __('Save'); ?>" />
    <?php echo __('or'); ?> <a href="<?php echo (AuthUser::hasPermission('administrator')) ? get_url('supplier') : get_url(); ?>"><?php echo __('Cancel'); ?></a>
  </p>

</form>

<script type="text/javascript">
// <![CDATA[
Field.activate('supplier_name');
// ]]>
</script>
